def process_text(text: str) -> str:
    """
    转义 % 变成 \%，已经转义的不需要再转义
    参数：
        text (str): 原始文本。
    返回：
        str: 处理后的文本。
    """
    result = ""
    i = 0
    while i < len(text):
        if i < len(text) - 1 and text[i:i+2] == '\\%':
            # Already escaped percent sign, leave it as is
            result += '\\%'
            i += 2
        elif text[i] == '%':
            # Unescape percent sign, escape it
            result += '\\%'
            i += 1
        else:
            # Normal character, add as is
            result += text[i]
            i += 1
    return result
